<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp"%>
<form id="fileForm" name="fileForm">
   <input type="hidden" name="token" value="${token}" id="token">
   <input type="hidden" name="tag" id="tag" value="${tag}">
   <input type="hidden" name="tableName" id="tableName" value="">
   <input type="hidden" name="partId" id="partId" value="">
   <input type="hidden" name="tableField" id="tableField" value="">
   <input type="hidden" name="attId" id="attId" value="">
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" style="width:1000px;max-height:700px">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-hidden="true">&times;</button>
						<h4 class="modal-title" id="myModalLabel">新增/修改文件</h4>
					</div>
					<div class="modal-body">
						<table class="table"  style="border: none;margin-bottom: -14px">
							<tbody>
								<tr>
									<td  id="eremark">选择文件:</td>
									<td colspan="3">
									<input id="file-0a" class="file" name="file" type="file" data-min-file-count="1">    
									</td>
								</tr>
								<tr>
									<td  id="efileOrg">发文单位<font color="red">&nbsp;*</font>:</td>
									<td  class="eminput" style="width:350px">
										<input name="fileOrg" id="fileOrg" maxlength="40" type='text' value="" class="required">
									</td>
									<td id="efileNo">文件编号<font color="red">&nbsp;*</font>:</td>
									<td style="width:350px">
										<input name="fileNo" id="fileNo" maxlength="50" type='text' value="" class="required">
									</td>
								</tr>
								<tr>
									<td  id="ereelNumber">卷　　号:</td>
									<td  class="eminput">
										<input name="reelNumber" id="reelNumber" maxlength="40" type='text' value="" >
									</td>
									<td id="enumber">　第X本:</td>
									<td>
										<input name="number" id="number" maxlength="10" type='text' value="">
									</td>
								</tr>
								<tr>
									<td  id="efileTime">发文日期<font color="red">&nbsp;*</font>:</td>
									<td  class="eminput">
										<input  id="fileTime" name="fileTime" value="" class="required"
										onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" class="Wdate" type="text">
									</td>
									<td id="eownOrg">所属单位<font color="red">&nbsp;*</font>:</td>
									<td>
										<input name="ownOrg" id="ownOrg" maxlength="40" type='text' value="" class="required">
									</td>
								</tr>
								<tr>
									<td>文件类型：</td>
									<td>
										<select name="data-tag">
										<c:forEach items="${list}" var="menu"  varStatus="idxStatus">
											<c:if test="${menu.remark!='public'}">
												<option value="${menu.tag}" ${idxStatus.index==0?'selected=selected':''} >${menu.name}</option>
											</c:if>
										</c:forEach>
										</select>
									</td>
									<td  id="eremark">备注:</td>
									<td  >
										<input name="remark" id="remark" maxlength="50" type='text' value="" >
									</td>
								</tr>
								<tr>
									<td  id="eremark">文件描述:</td>
									<td  colspan="3" >
										<div class="wordCount wyInline" id="fileDesc_wordCount">
											<textarea placeholder="文件内容描述" rows='3' id="fileDesc"
												name="fileDesc"></textarea>
											<span class="wordwrap"><var class="word">512</var>/512</span>
										</div>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="modal-footer" style="padding:4px 15px 5px;">
						<button type="button" class="btn btn-default" data-dismiss="close">关闭</button>
						<button type="submit" class="btn btn-primary" id="sub" >提交</button>
					</div>
				</div>
				<!-- /.modal-content -->
			</div>
			<!-- /.modal -->
		</div>
</form>
<script src="${ctxStatic}/js/attachment/upload.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function()
		{
	 		
			$("#fileOrg").focus();
			$("#fileForm").validate({
				debug:true,
				rules: {
					
				},
				messages: {
					
				},
				submitHandler:function(form){
					if(checkFileName('file')){
						$('#sub').attr('disabled','disabled');  //防止重复提交，请求完毕之前禁用提交按钮
						uploadSubmit();
					}
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
</script>
	